﻿using EBA.Collections;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace EBA.Reporting.Data
{
    class AdoReportDataRow : IReportDataRow
    {

        public AdoReportDataRow(DataRow row, int index)
        {
            this.RowIndex = index;
            this.ColumnCells = new AdoReportDataCellCollection();

            for (int i = 0; i < row.ItemArray.Length; i++)
            {
                ColumnCells.Add(new AdoReportDataCell(index, i, (string)row[i]));
            }
        }

        public int RowIndex
        {
            get;
            set;
        }

        private AdoReportDataCellCollection ColumnCells
        {
            get;
            set;
        }

        IReadonlyList<IReportDataCell> IReportDataRow.ColumnCells
        {
            get
            {
                return this.ColumnCells;
            }
        }
    }
}
